package cn.sale.entity;

import cn.sale.tool.Const;

public class Name implements Comparable<Name> {
	
	private String first;

	private String seconde;
	
	public Name(){
		
	}
	
	public Name(String name){
		if(name.contains(Const.nameGap)){
			this.first = name.split(Const.nameGap)[0];
			this.seconde = name.split(Const.nameGap)[1];
		}else{
			this.first = name;
			this.seconde = "";
		}
	}
	
	@Override
	public String toString() {
		return this.first+Const.nameGap+this.seconde;
	}

	@Override
	public int compareTo(Name o) {
		return this.toString().compareTo(o.toString());
	}

	public String getFirst() {
		return first;
	}

	public void setFirst(String first) {
		this.first = first;
	}

	public String getSeconde() {
		return seconde;
	}

	public void setSeconde(String seconde) {
		this.seconde = seconde;
	}
	
	
	

}
